<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript">
            function getxhr() {
                var xhr=null;
                if (window.XMLHttpRequest) {
                    var xhr=new XMLHttpRequest();
                }
                else
                    if (window.ActiveXObject) {
                        var xhr=new ActiveXObject("Microsoft.XMLHTTP");
                    }
                else {
                    alert("navigateur non compatible Ajax...");
                }
                
                xhr.onreadystatechange=function(){
                    if (xhr.readyState==4 && xhr.status==200){
                        document.getElementById('out').innerHTML=xhr.responseText;
                    }
                }
                xhr.open("GET","roismage.txt",true);
                xhr.send(null);
            }
        </script>
    </head>
    
    <body>
        <p>Le nom des rois mage est ? <a href="#" onclick="getxhr();">Réponse<a/></p>
        <p id="out">
        </p>
    </body>
</html>
